import sys
from PyQt5.QtWidgets import QApplication
from views.ui.welcome_screen import WelcomeScreen

from service.loginOp import MyWindow
from PyQt5 import QtWidgets,QtCore,QtGui

class MainApp:
    def __init__(self):
        self.app = QApplication(sys.argv)
        self.welcome_screen = None
        self.login_screen = None

    def show_welcome_screen(self):
        self.welcome_screen = WelcomeScreen(self.show_login_screen)
        self.welcome_screen.show()

    def show_login_screen(self):
        self.login_screen = MyWindow()
        self.login_screen.show()
        if self.welcome_screen:
            self.welcome_screen.close()

    def run(self):
        self.show_welcome_screen()
        sys.exit(self.app.exec_())


if __name__ == "__main__":
    QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling) 
    app = MainApp()
    app.run()
